package com.tiger.log.server.mapper;

import com.tiger.log.common.entity.SysAuthLog;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @InterfaceName SysAuthLogMapper
 * @Description TODO
 * @Author huxuehao
 **/
@Repository
public interface SysAuthLogMapper {
    List<SysAuthLog> selectAll();

    SysAuthLog selectById(@Param("id") String id);

    List<SysAuthLog> selectByUserCode(@Param("userCode") String userCode);

    int add(@Param("authLog") SysAuthLog authLog);

    int deleteAll();

    int deleteByIds(@Param("ids") List<String> ids);

    int deleteByUserCodes(@Param("userCodes") List<String> userCodes);

    /* 查询日志表中日周期 */
    String selectDayCycle();

    /* 复制表，实现日志轮转 */
    int copyTable(@Param("tableName_n") String tableName_n);

    /* 如果存在tableName_n表，则清空日志表的日志 */
    int delRecordsIFExist(@Param("tableName_n") String tableName_n);
}
